//
// Decompiled by Jadx - 402ms
//
package fh;

import android.app.Activity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.activity.b;
import androidx.appcompat.app.t;
import androidx.recyclerview.widget.RecyclerView;
import cc.c;
import cc.s;
import fh.j;
import fi.w;
import fi.y;
import fm.l;
import gc.af;
import gj.d;
import gj.k;
import java.io.IOException;
import me.plusne.common.Http.Home;
import me.plusne.common.Http.Hook;
import me.plusne.common.Http.Vote;
import r.f;
import s.ag;
import s.ao;
import s.l;
import s.m;

public final class g implements View.OnClickListener {
    public final int a;
    public final Object b;
    public final Object c;
    public final Object d;

    public g(Object obj, Object obj2, Object obj3, int i) {
        this.a = i;
        this.b = obj;
        this.c = obj2;
        this.d = obj3;
    }

    @Override
    public final void onClick(View view) {
        f p;
        String str;
        f p2;
        String str2;
        f p3;
        String str3;
        int i = this.a;
        boolean z = false;
        Object obj = this.d;
        Object obj2 = this.c;
        Object obj3 = this.b;
        switch (i) {
            case 0:
                j.a aVar = (j.a) obj3;
                MediaPlayer mediaPlayer = (MediaPlayer) obj;
                aVar.getClass();
                f i2 = f.i();
                i2.k();
                i2.l("正在加载中...");
                String str4 = ((l) obj2).b;
                ProgressBar progressBar = aVar.b;
                if (progressBar != null) {
                    progressBar.setProgress(0);
                    progressBar.setVisibility(8);
                }
                if (mediaPlayer.isPlaying()) {
                    mediaPlayer.stop();
                }
                mediaPlayer.setOnPreparedListener(new h(aVar, mediaPlayer));
                mediaPlayer.seekTo(0);
                try {
                    mediaPlayer.reset();
                    mediaPlayer.setDataSource(str4);
                    mediaPlayer.prepare();
                    mediaPlayer.start();
                    return;
                } catch (IOException | IllegalStateException e) {
                    e.printStackTrace();
                    ((RecyclerView.ae) aVar).itemView.performClick();
                    f i3 = f.i();
                    i3.j();
                    i3.l(e.getMessage());
                    return;
                }
            case 1:
                d dVar = (d) obj3;
                s sVar = (s) obj2;
                Activity activity = (Activity) obj;
                dVar.getClass();
                if (!r.g.s(sVar.e.getText().toString())) {
                    p2 = b.p(activity);
                    p2.d = 48;
                    str2 = "账号格式错误,6-16位数字或者字母";
                } else {
                    EditText editText = sVar.d;
                    if (!r.g.s(editText.getText().toString())) {
                        p2 = b.p(activity);
                        p2.d = 48;
                        str2 = "密码格式错误,6-16位数字或者字母";
                    } else {
                        String obj4 = sVar.e.getText().toString();
                        String obj5 = editText.getText().toString();
                        Activity activity2 = dVar.b;
                        y.e(activity2);
                        t.c().j(((Hook) dq.b.b(Hook.class)).queryLoginInfo(obj4, obj5).subscribeWith(new gj.b(dVar, activity2, obj5, obj4)));
                        return;
                    }
                }
                p2.l(str2);
                return;
            case 2:
                k kVar = (k) obj3;
                y.e(kVar.d);
                new Thread((Runnable) new af(kVar, (s) obj2, (w) obj, 3)).start();
                return;
            case 3:
                c cVar = (c) obj2;
                Activity activity3 = (Activity) obj;
                ((s.l) obj3).getClass();
                String obj6 = ((EditText) cVar.d).getText().toString();
                String obj7 = ((EditText) cVar.h).getText().toString();
                if (TextUtils.isEmpty(obj7)) {
                    p3 = b.p(activity3);
                    p3.d = 48;
                    str3 = "请填写框架名称";
                } else if (obj7.length() > 30) {
                    p3 = b.p(activity3);
                    p3.d = 48;
                    str3 = "框架名称请输入小于30字的内容";
                } else if (TextUtils.isEmpty(obj6)) {
                    p3 = b.p(activity3);
                    p3.d = 48;
                    str3 = "请填写详细的问题描述";
                } else if (obj6.length() > 500) {
                    p3 = b.p(activity3);
                    p3.d = 48;
                    str3 = "描述问题请输入小于500字的内容";
                } else {
                    String obj8 = ((EditText) cVar.i).getText().toString();
                    Uri parse = Uri.parse(obj8);
                    if (parse != null && parse.getScheme() != null) {
                        z = true;
                    }
                    if (!z) {
                        p3 = b.p(activity3);
                        p3.d = 48;
                        str3 = "框架日志网盘URL错误";
                    } else {
                        String charSequence = ((TextView) cVar.g).getText().toString();
                        if (!TextUtils.isEmpty(charSequence) && !charSequence.equals("选择出现问题的App")) {
                            if (charSequence.length() > 100) {
                                p3 = b.p(activity3);
                                p3.d = 48;
                                str3 = "问题App请输入小于100字的内容";
                            } else {
                                y.f(activity3, "正在提交...");
                                String o = r.g.o();
                                t.c().j(((Home) dq.b.b(Home.class)).issue(obj6, obj7, obj8, charSequence, o).subscribeWith(new l.a(activity3, activity3)));
                                return;
                            }
                        } else {
                            p3 = b.p(activity3);
                            p3.d = 48;
                            str3 = "请选择问题App";
                        }
                    }
                }
                p3.l(str3);
                return;
            case 4:
                m mVar = (m) obj3;
                cc.f fVar = (cc.f) obj2;
                me.plusne.Adapter.Login.g gVar = (m.a) obj;
                mVar.getClass();
                boolean s = r.g.s(((EditText) fVar.g).getText().toString());
                Activity activity4 = mVar.b;
                if (s && r.g.s(((EditText) fVar.f).getText().toString())) {
                    fn.b.l(((EditText) fVar.g).getText().toString(), "login_user");
                    fn.b.l(((EditText) fVar.f).getText().toString(), "login_pass");
                    if (fn.b.h("autoLogin", false)) {
                        if (gVar != null) {
                            gVar.e(fn.b.g("login_user", ""), fn.b.g("login_pass", ""));
                            return;
                        }
                        return;
                    }
                    y.c(activity4, "自动登录", "下次是否自动登录", "确认", new fi.k(20, gVar));
                    return;
                }
                b.r(activity4, "账号或者密码格式错误,6-16位数字或者字母");
                return;
            default:
                ao aoVar = (ao) obj3;
                cc.b bVar = (cc.b) obj2;
                w wVar = (w) obj;
                aoVar.getClass();
                String obj9 = ((EditText) bVar.h).getText().toString();
                String obj10 = ((EditText) bVar.g).getText().toString();
                boolean isEmpty = aoVar.f.isEmpty();
                Activity activity5 = aoVar.e;
                if (isEmpty) {
                    b.r(activity5, "请选择提交功能的App");
                    bVar.a.performClick();
                    return;
                }
                if (obj9.isEmpty()) {
                    p = b.p(activity5);
                    str = "请填写标题";
                } else if (obj9.codePointCount(0, obj9.length()) > 20) {
                    p = b.p(activity5);
                    str = "标题不能超过20个字符";
                } else if (obj10.isEmpty()) {
                    p = b.p(activity5);
                    str = "请填写功能描述";
                } else if (obj10.codePointCount(0, obj10.length()) > 100) {
                    p = b.p(activity5);
                    str = "功能描述不能超过100个字符";
                } else {
                    y.e(activity5);
                    String token = aoVar.a.getToken();
                    String str5 = aoVar.f;
                    t.c().j(((Vote) dq.b.b(Vote.class)).submit(token, str5, obj9, obj10).subscribeWith(new ag(aoVar, activity5, wVar)));
                    return;
                }
                p.l(str);
                return;
        }
    }
}
